import axios from "axios";
import md5 from 'blueimp-md5';

export default {
    phone(phone){
        return axios.post('/login_message/phone',
            {
                phone
            })
    },
    code(phone){
        return axios.post('/login_message/code', {
            phone
        })
    },
    checkCode(phone, code){
        return axios.post('/user/checkCode', {
            phone,
            // md5用来给验证码加密
            code: md5(code)
        })
    },
    register(options){
        return axios.post('/register', options);
    }
}